import { createRouter, createWebHistory } from "vue-router";

// 导入组件
import LayoutVue from '@/views/Layout.vue';
import LoginVue from '@/views/Login.vue';
import ArticleCategoryVue from '@/views/article/ArticleCategory.vue';
import ArticleManagerVue from '@/views/article/ArticleManager.vue';
import ArticleDetailVue from "@/views/article/ArticleDetail.vue";
import Comment from "@/views/comment/Comment.vue";
import Home from "@/views/Home.vue";
import UserManagerVue from "@/views/user/UserManager.vue";
import feedbackVue from "@/views/feedback/feedback.vue";
// 定义路由关系
const routes = [
    {path:'/', component: LoginVue},
    // {path: '/home', component: Home},
    {path:'/layout', component: LayoutVue,redirect: '/article/manage', children:[
        {path:'/article/category', component: ArticleCategoryVue},
        {path:'/article/manage', component: ArticleManagerVue},
        {path:'/user/manage', component: UserManagerVue},
        {path:'/feedback', component: feedbackVue},
    ]},
    {path:'/article/detail/:id', component: ArticleDetailVue},
]
// 创建路由器
const router = createRouter({
    history: createWebHistory(),
    routes: routes
})

// 导出路由
export default router